package org.apache.james.mime4j.field.address;

import java.util.ArrayList;

public class Group extends Address
{
  private MailboxList mailboxList;
  private String name;

  public Group(String paramString, MailboxList paramMailboxList)
  {
    this.name = paramString;
    this.mailboxList = paramMailboxList;
  }

  protected void doAddMailboxesTo(ArrayList paramArrayList)
  {
    for (int i = 0; i < this.mailboxList.size(); ++i)
      paramArrayList.add(this.mailboxList.get(i));
  }

  public MailboxList getMailboxes()
  {
    return this.mailboxList;
  }

  public String getName()
  {
    return this.name;
  }

  public String toString()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append(this.name);
    localStringBuffer.append(":");
    for (int i = 0; i < this.mailboxList.size(); ++i)
    {
      localStringBuffer.append(this.mailboxList.get(i).toString());
      if (i + 1 < this.mailboxList.size())
        localStringBuffer.append(",");
    }
    localStringBuffer.append(";");
    return localStringBuffer.toString();
  }
}